A digital image is conventionally formed of pixel rows and columns. Each pixel, located by an abscissa and an ordinate, is in particular associated with a color. The colors of all pixels of a same image are conventionally coded with a same number of bits, this number determining the number of possible colors for each pixel. As an example, a coding (called RGB coding) is considered, in which the colors are represented by three components: red (R), green (G), and blue (B), each of which is coded over eight bits. Such a coding enables describing 23×8, that is, more than 16 million different colors.
FIG. 1 very schematically shows a fragment of a digital image 2, organized in pixel lines and columns. Each pixel i of image 2 is located by an abscissa X(i) and an ordinate Y(i), and is associated with a color RGB(i). In FIG. 1, the two first pixels 0 and 1 of the first line of image 2 have been shown. Considering that image 2 is organized in lines of n pixels, the two first pixels of the second image line are designated by n and n+1. An example of color coded over 24 bits has been associated with each of the shown pixels. For clarity, each of components R(i), G(i), and B(i) is shown in hexadecimal. Pixel 0 has a color RGB(0)=F11, pixel 1 has a color RGB(1)=1A1, pixel n has a color RGB(n)=1B0, and pixel n+1 has a color RGB(n+1)=CE0.
In certain applications, it may be desired to reduce the number of bits associated with the colors of a digital image. An image of a given number of pixels having its colors coded over a large number of bits represents a large number of bits, and reducing this number may enable storing the image in a reduced memory space or transmitting it, for example with a modem, in a shorter time.
A known solution consists of creating a look-up table, or color look-up table (CLUT) containing a restricted number of colors coded like the original colors of the pixels. Each pixel then is associated with an address chosen in the look-up table, which corresponds to the CLUT color that is closest to its original color.
FIG. 2 schematically shows a circuit 4 enabling performing an approximation such as described hereabove of the color of the pixels of an image. Circuit 4 includes a memory (MEM) 6 in which are stored the CLUT colors and an evaluation circuit (EVAL) 8, a first input of which receives the CLUT colors, and a second input of which successively receives the original color of each pixel. For the type of coding taken as an example, if Rp, Gp, and Bp are the components of a color of the look-up table, the difference between an original color RGB(i) of a pixel i and this color can be calculated as |R(i)−Rp|+|G(i)−Gp|+|B(i)−Bp|. The search for the closest CLUT color to the original color of a pixel can be performed by systematically scanning the entire look-up table, but can also be performed by means of faster search algorithms, for example, a search algorithm taking the successive median colors between the closest colors obtained in the look-up table for the preceding evaluations of the same pixel while however determining, for each evaluation, the sign of the difference. Once it has determined the CLUT color which is closest to the original color of a pixel, evaluation circuit 8 selects this CLUT color (CLUT(RGB(i))) by associating with pixel i the address of this color in the color look-up table. As indicated previously, the color look-up table includes a reduced number of colors. The address of the CLUT colors thus comprises a reduced number of bits. By replacing for each pixel of an image the code of its original color by such an address, the memory size of the digital image is substantially reduced. As an example, by associating with the colors coded over 24 bits of a digital image an address of a color of a color look-up table of 256 colors, coded over 8 bits, the size of this image is substantially divided by 3.
FIG. 3 very schematically shows a digital image 10 corresponding to digital image 2 of FIG. 1 after approximation of its colors. In the case shown, it is assumed that the CLUT colors that are closest to the original colors of pixels 0, 1, n and n+1 of image 2 respectively are the colors having codes F00, 1A0, 1A0 and CA0. Evaluation circuit 8 associates CLUT color F00 with original color F11 of pixel 0, CLUT color 1A0 with original colors 1A1 of pixel 1 and 1B0 of pixel n, and CLUT color CA0 with original color CEO of pixel n+1.
It should be noted that such an approximation method results in a loss of information by associating with several different original colors the same CLUT color. Thus, it eliminates from an image the color blendings that may be present, and it creates uniform color areas abruptly separated from one another. This phenomenon is particularly disturbing, for example, when the digital image includes areas such as a face, including many blendings of flesh color of different shades, exhibiting a low contrast with respect to one another. The previously-described approximation of the colors of a face conventionally displays a reduced number of areas with a strong contrast between one another, which is not very attractive.
Such a problem can be attenuated by a judicious choice of the color look-up table. In the preceding example, this amounts to storing in the CLUT a sufficient number of shades of flesh color to enable a convenient approximation of the color blendings in a face. However, such a solution is not always implementable, the CLUT size being limited.
Another known solution to attenuate the contrast between the color areas created by the preceding approximation method consists of artificially mixing the colors of the pixels located at the border of the areas of same color in the image. Thereby, after approximation, the separation border between the color areas is no longer clear, but has the aspect of a cloud of points. The human eye mixes the colors of the points of this cloud into a homogeneous color and it accepts this recomposed color as being an intermediary color between the two color areas. This mixing of the border pixel color is performed by adding a correction term to the original color of each pixel before its approximation. This correction term is a function of the evaluation errors of the preceding pixels, each assigned with predetermined weighting coefficients.
FIG. 4 schematically shows the preceding pixels i−1, i−n−1, i−n and i−n+1 conventionally used for approximating the original color of a pixel i of an image 2. It should be noted that pixel i−n represents a pixel of the preceding line, of same abscissa as i. In known solutions, it has been determined that correction term E(i), added to original color RGB(i) of pixel i for its approximation must, to obtain an acceptable result, be equal to:K1.ERR(i−1)+K2.ERR(i−n−1)+K3.ERR(i−n)+K4.ERR(i−n+1), where K1, K2, K3 and K4 are predetermined fixed coefficients, and where ERR(i−1), ERR(i−n−1), ERR(i−n), and ERR(i−n+1) correspond to the error approximations calculated for pixels i−1, i−n−1, i−n, and i−n+1. In other words,ERR(i)=|RGB(i)+E(i)−CLUT(RGB(i)+E(i))|. 
To obtain good results, the coefficients generally are the following: K1={fraction (7/16)}, K2={fraction (1/16)}, K3={fraction (5/16)}, and K4={fraction (3/16)}.
Such a method amounts to adding, to the future values of the four pixels adjacent to the current pixel: {fraction (7/16)} of the current error to the right-hand pixel (i+1), {fraction (3/16)} of the error to the lower left-hand pixel (i+n−1), {fraction (5/16)} of the error to the lower pixel (i+n), and {fraction (1/16)} of the error to the lower right-hand pixel (i+n+1).
A first disadvantage of the above conventional method is that it requires, for the processing of each pixel, effecting four multiplications to weight the evaluation errors of the preceding pixels, and four additions to calculate the correction term. These multiplications and additions are effected on codes having the length of the codes of the original pixel color, that is, including a large number of bits. Thus, such operations are relatively complex to implement, in particular in an integrated circuit.
A second disadvantage is that, to process a pixel of an image line, it is necessary to store in the memory the evaluation errors of three preceding pixels located on the preceding image line. Thus, this approximation method requires permanently memorizing the approximation errors calculated for the pixels of the entire preceding line. These approximation errors must be stored in a specific memory, which increases the complexity of a circuit intended for implementing this method.